import request  from "./request"
import requestmock  from "./requestmock"

export const service=({url,method,data,params})=>request({url,method})
export const servicemock=({url,method,data,params})=>requestmock({url,method})
export const serviceSimple=(params)=>request(params)




//应该将所有的请求统一起来
export function getConfirmCode(phone){return request({url:`/user/passport/sendCode/${phone}`})}

export const register=({phone,password,code})=>{return request({url:`/user/passport/register`,method:'post',data:{phone,password,code}})}

export const login=({phone,password})=>{return request({url:'/user/passport/login',method:'post',data:{phone,password}})}

export const getUserInfo=()=>{return request({url:'/user/passport/auth/getUserInfo'})}

export const logout=()=>{return request({url:'/user/passport/logout'})}